UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WUx1tC7meEualQymWDbfvy7XMmhb9bkYLBfkHQLxSRc='
WHERE
key_id = '37504b89fa791731311b157715525dafbffed3c73cc4177f794de78e9da1b8a5'
AND (
token = 'WUx1tC7meEualQymWDbfvy7XMmhb9bkYLBfkHQLxSRc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)