UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ktVY6PSFn3zhjLrlfMvT5EGJhQlVP7wPHOhjetSxj1c='
WHERE
key_id = '36d6aad1311227d5334cfe90f4daab92858ee02a6c72a1d502d9c99c0e1602c4'
AND (
token = 'ktVY6PSFn3zhjLrlfMvT5EGJhQlVP7wPHOhjetSxj1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)