UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HOH2btjyanbvgXj/H82DrPqWx+3mftP94S1YxLCi6R4=' 
WHERE 
  key_id = 'c35a9710563233c8c7ee84557f71204630d08cfd71dc1f6e2ee80a4d52c696e7' 
  AND (
    token = 'HOH2btjyanbvgXj/H82DrPqWx+3mftP94S1YxLCi6R4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028