UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'edxpJQHjbZ/zD3fE4OKN6UqYX57ERVWSrDRQkSZ4L6k=' 
WHERE 
  key_id = 'f6cfbd1f04a8fa866bdd88cd4fb209d231402bb624f4211547155d126ef1c514' 
  AND (
    token = 'edxpJQHjbZ/zD3fE4OKN6UqYX57ERVWSrDRQkSZ4L6k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025