UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9xAdOreCiR6EumHs1Ado3iENK6EaraTgmJ99ILQIo+U='
WHERE
key_id = '960cd8b8a22bff466f88e06dd7e38eb40924bc4c3718f29292f2c23a9fc70ae8'
AND (
token = '9xAdOreCiR6EumHs1Ado3iENK6EaraTgmJ99ILQIo+U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)