UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZlgAPZ3xilmq/PTxk46sQUBMyDbq2gGd0aACmKZPk0Y='
WHERE
key_id = '36075d3f9720182d508dcd4796b0be04e3fdfd73df96d0ba12226b77d36afabc'
AND (
token = 'ZlgAPZ3xilmq/PTxk46sQUBMyDbq2gGd0aACmKZPk0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)