UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n++xaIBZXOBuVmJEezghyrTwOQhvJj3jVQgb7PSDeMo='
WHERE
key_id = 'f1f1956bd901fb47cf4497f176092b956cae5da11354e18f4b84a45c15976814'
AND (
token = 'n++xaIBZXOBuVmJEezghyrTwOQhvJj3jVQgb7PSDeMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)