UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qZpEH/yBXzODrooTIvmcife28cn5EHYoJI4vSxmBzk4='
WHERE
key_id = 'd3fb560cddb5eaac9cdb265c97df610cb63b867fae2877720b86ac602e29c94d'
AND (
token = 'qZpEH/yBXzODrooTIvmcife28cn5EHYoJI4vSxmBzk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)