UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ehhOsnei1ywXzX4KF5f1WDPKUpLMWKuRXcQpRfuEARg=' 
WHERE 
  key_id = '0ce641d01256c526b7b7c765536a1bdeb1da1f6a1b307d737ff6bf7e9a37dd4a' 
  AND (
    token = 'ehhOsnei1ywXzX4KF5f1WDPKUpLMWKuRXcQpRfuEARg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030