UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Zuiml1WWE1clBco/+oQfJXGnMyaEqf+/kRUqFhiXjc=' 
WHERE 
  key_id = 'ad8e51576447724db792ce3b7d530981ccecbd98755ca46e9cf12b2550d85812' 
  AND (
    token = '3Zuiml1WWE1clBco/+oQfJXGnMyaEqf+/kRUqFhiXjc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019