UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LZHz6r8TG3EEnHFpP+kXet9R+gF6MuVDkwmMOHf0Cc0='
WHERE
key_id = '1d7c8127e84fd97e35837049bd102959d7df080f618b28fdb248bcb2faf024b4'
AND (
token = 'LZHz6r8TG3EEnHFpP+kXet9R+gF6MuVDkwmMOHf0Cc0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)