UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KxMXLM5VLE9zEK0qduBH4s/qoUEn7sF0bz3rvjTlHHE=' 
WHERE 
  key_id = 'eece44868183be53f73e42473378fee044d0056859e5588b1dc4ec1766b5cfa3' 
  AND (
    token = 'KxMXLM5VLE9zEK0qduBH4s/qoUEn7sF0bz3rvjTlHHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053