UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Owc+LXoUHPiege9ocQay9qlLZHp9pVAr7PSmHfEtL4M=' 
WHERE 
  key_id = '3407c54b69f6bb2b1e686bdd1567dcb328eb5f98a98159effe701bfdec82a086' 
  AND (
    token = 'Owc+LXoUHPiege9ocQay9qlLZHp9pVAr7PSmHfEtL4M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025