UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L7/JnNkiwYJVeLtt+bRWTUbQg770qADrOuvd5KcXEJE='
WHERE
key_id = 'bef5bdc2a8aeeb96ccf39b3f557357c3c66e3aa975c0eed7fef1b0b6de07d624'
AND (
token = 'L7/JnNkiwYJVeLtt+bRWTUbQg770qADrOuvd5KcXEJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)