UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nXqVsBn5Lm7P8mwUP+NJSmG3qVLt0tRfVzvecteysN4='
WHERE
key_id = 'eb2f9177335539ec1387356034890b4fece396216fff5f96bf69d40f37251d0b'
AND (
token = 'nXqVsBn5Lm7P8mwUP+NJSmG3qVLt0tRfVzvecteysN4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)