UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Em1HVRla7j6uMzKOz/3cA9Q9fAUQC9YWZVV0/OsGKg='
WHERE
key_id = 'fcd24df0e5635c1e6f7d21b7d531650bd58f33559bccfd9d5dce26c3567998d9'
AND (
token = '/Em1HVRla7j6uMzKOz/3cA9Q9fAUQC9YWZVV0/OsGKg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)