UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HSz7DDu+VJphcK6p/fwC3aYEFTysEYNZxFElzTArJjA='
WHERE
key_id = 'd4c2655b562f66be95f0dc008d98291af7a9a1fbe774aeb45bcc2b2674cbef78'
AND (
token = 'HSz7DDu+VJphcK6p/fwC3aYEFTysEYNZxFElzTArJjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)