UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hCOBcfH9UqwslajZansVkLpKWYcxT8fhzvrCHR2r7HM=' 
WHERE 
  key_id = '232f53ecc20fef33c285ab5bcbc9a7b4ab380a58cfa8d324264a9ac496704030' 
  AND (
    token = 'hCOBcfH9UqwslajZansVkLpKWYcxT8fhzvrCHR2r7HM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039