UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C2fNSUf5hWRkklGAyqgS371/SwJhWY3K1BpIyZvQfUk='
WHERE
key_id = '08b33da65b9ad3686b134e6ac30d4022dfbf5945d2da608fe525aac3875241e1'
AND (
token = 'C2fNSUf5hWRkklGAyqgS371/SwJhWY3K1BpIyZvQfUk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)