UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hO/IlAa7/+WKe0oOld1uvwyricTUViQtNhA+fx507ZI='
WHERE
key_id = '7af6ccea2767deefed49bef014218f361bbfa4d4f9bbe611685771c044236590'
AND (
token = 'hO/IlAa7/+WKe0oOld1uvwyricTUViQtNhA+fx507ZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)