UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cOSEDLPiQ988KdZFR71skH/p+FzNiTh4Y4dtOAKIr8o=' 
WHERE 
  key_id = '722669f1f72477f52b3e616732317562e8d3e4da597733e58fed0caa85fde582' 
  AND (
    token = 'cOSEDLPiQ988KdZFR71skH/p+FzNiTh4Y4dtOAKIr8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033