UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X7XfrXMQQP6CwyCBQfPpR7eyvP5g8oWBTB3eyZllngk='
WHERE
key_id = 'b0d30af6e5a1577fbc089d716c95079bcceea627a334b57e479add42bcd91c17'
AND (
token = 'X7XfrXMQQP6CwyCBQfPpR7eyvP5g8oWBTB3eyZllngk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)