UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8KmlgnTgfLCHE5jX7OQ2ScLXfBw66T4HW9nQ9pkCZtQ='
WHERE
key_id = '6ed06fbc50dc5b7d7fd56bf902b1bd2ca9cb1e359691f21e141276532f5d5962'
AND (
token = '8KmlgnTgfLCHE5jX7OQ2ScLXfBw66T4HW9nQ9pkCZtQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)