UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ep//ydZHijD2rZ7sG2tfAtzOAZF9PBVXU0PIIz7POIk=' 
WHERE 
  key_id = '3ef56f77ca33fa0e5f279520f14150d12dd114b891df72219c2464f65ab55105' 
  AND (
    token = 'ep//ydZHijD2rZ7sG2tfAtzOAZF9PBVXU0PIIz7POIk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033