UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dtmFpdTGrVDX0Jt/TLC3jMJ0JzcDlMPhEG3/bp+IgNg='
WHERE
key_id = '692ab1f5e7e490f842387b0a2afc6f07d1fa95c4bd1943bf5d4c8ca0139ff561'
AND (
token = 'dtmFpdTGrVDX0Jt/TLC3jMJ0JzcDlMPhEG3/bp+IgNg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)