UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KOIL+2XEiINV+IU+ScHbH30QKb/ackSjd5c6AUSIkxE='
WHERE
key_id = '88e3d33d39cdc5cafa46bc017a7ec1c54bf7d1d0e2cf4bf6f26f9b755f1a9304'
AND (
token = 'KOIL+2XEiINV+IU+ScHbH30QKb/ackSjd5c6AUSIkxE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)