UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OPlQDAlUmzhY0s9VHibPTKC0hJ+GAOH6qOqigiDtLKE=' 
WHERE 
  key_id = 'd8b383ff2316d919e4bdc68cd18577eb697efb3ec2f8b09259eaf8e511c451b7' 
  AND (
    token = 'OPlQDAlUmzhY0s9VHibPTKC0hJ+GAOH6qOqigiDtLKE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019