UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uvog7VKFmHupLYt1e6a8CHoGK16JKE4jzCK5gLQ8+Nw='
WHERE
key_id = '14b7e75a94940294c4f4f9c116669b1d3dc5ba55acffc360c1b3aa2c56f5cb3f'
AND (
token = 'Uvog7VKFmHupLYt1e6a8CHoGK16JKE4jzCK5gLQ8+Nw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)