UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NIe2dLn1E+GspjDn+YUCWiwnEF4nzhpsyjp/fIVFL34='
WHERE
key_id = '70c67f2f3d5bb97d7d0b7db1d64d2b0eb9976682e21cbe5370af3f295e87fcdf'
AND (
token = 'NIe2dLn1E+GspjDn+YUCWiwnEF4nzhpsyjp/fIVFL34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)