UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zGeWaFWR24heISF6UQLMAJGZXqgIXZ7Nob+qdpUASQk='
WHERE
key_id = '1dc53f398f171eee355196cdabcfbc67229e143c8596be22772d04fe60c28d0b'
AND (
token = 'zGeWaFWR24heISF6UQLMAJGZXqgIXZ7Nob+qdpUASQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)